//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
#ifndef CPROP_VNC_HPP
#define CPROP_VNC_HPP

#include "CWindow.h"
#include "GenericPropClasses.hpp"


class CPropVNC : public CTerminalPropPage
{
public:
	virtual BOOL Validate();
	virtual BOOL StoreData();
	CPropVNC (CTerminalPropSheet *pOwner = NULL);
	~CPropVNC();

	virtual BOOL WriteRegistrySettings();
	virtual BOOL ReadRegistrySettings();


	LPCTSTR GetId()
	{ return TEXT("General"); }

	BEGIN_MSG_MAP(CPropVNC)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		NOTIFY_HANDLER (0, PSN_SETACTIVE, OnSetActive)
		COMMAND_HANDLER (IDC_REMOTE_CTRL, BN_CLICKED , OnEnableRemoteControl)
		COMMAND_HANDLER (IDC_PWD1       , EN_CHANGE  , OnPwdChange)
		COMMAND_HANDLER (IDC_PWD1       , EN_SETFOCUS, OnFocus) 


		CHAIN_MSG_MAP (CTerminalPropPage)
	END_MSG_MAP()

	LRESULT OnSetActive (int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnEnableRemoteControl (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnPwdChange (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnFocus     (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);

protected:
	BOOL  m_remoteCtrl;
	BOOL  m_pwdWasChanged;
	TCHAR m_password[10];

	CWindow m_remoteCtrlWin;
	CWindow m_pwd1Win;
	CWindow m_pwd2Win;
};


#endif // CPROP_VNC_HPP
